<?php

namespace App\Repositories;
use Cache;
use App\Models\AdminEvaluate;
use App\Repositories\Repository;
use Illuminate\Support\Facades\DB;
class AdminEvaluateRepository extends Repository{

    static $tag = 'admin.evaluate';

    public function store($data)
    {
        $res = AdminEvaluate::firstOrCreate($data);
        return $res;
    }

    public function getEid($uid,$time)
    {
       return AdminEvaluate::select("eid","custom")
            ->where('uid', (int)$uid)
            ->where("created_at",$time)
            ->orderBy('id', 'desc')
            ->first();
    }




    public function model()
    {
        return app(AdminEvaluate::class);
    }

    public function tag()
    {
        return self::$tag;
    }

    public function cacheTime()
    {
        return config('testing.common_cache_time');
    }
}